# Contributor: qaqland <qaq@qaq.land>
# Maintainer: qaqland <qaq@qaq.land>
pkgname=pfetch-rs
pkgver=2.11.0
pkgrel=0
pkgdesc="A rewrite of the pfetch system information tool in Rust"
url="https://crates.io/crates/pfetch"
arch="all"
license="MIT"
makedepends="cargo cargo-auditable"
checkdepends="bash"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Gobidev/pfetch-rs/archive/refs/tags/v$pkgver.tar.gz"
options="net" # cargo fetch

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
	export PF_COLOR=0
	cd tools && ./print_all.sh ../target/release/pfetch
}

package() {
	install -Dm755 target/release/pfetch "$pkgdir"/usr/bin/pfetch-rs
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
3bfd93c7ff77348775ba6c76aadd2dc40a217847c90194de4d64b68ac1361b3ab6e0bf09cd91a5b712cc860ee3a59fbce9ac4fbb56a8f0ce1d7422582b58ef62  pfetch-rs-2.11.0.tar.gz
"
